<ion-view title="嘱托详情" hide-nav-bar="true">
    <ion-content class="detail-page">
        <table ng-show="vm.entrust != null">
            <tbody>
                <tr style="box-shadow: none;">
                    <td data-title="基本信息:" style="border: 0px;">
                        &nbsp;
                        <div ng-show="vm.loginAccount.memberType == '2'" style="display: block;float: right;">
                            <a href="javascript:;" class="ion ion-ios-more" id="showIOSActionSheet" ng-show="{{vm.clientType == 'ios'}}"></a>
                            <a href="javascript:;" class="ion ion-ios-more" id="showAndroidActionSheet" ng-show="{{vm.clientType == 'android'}}"></a>
                        </div>
                    </td>
                    <td data-title="嘱托宝宝:">{{vm.entrust.toEntrustChildName}}</td>
                    <td data-title="嘱托家长:">{{vm.entrust.entrustName}}</td>
                    <td data-title="被嘱托老师:">{{vm.entrust.toEntrustName}}</td>
                    <td data-title="执行状态：">{{vm.entrust.entrustState == 'execute' ? '已执行' : '未执行'}}</td>
                    <td data-title="嘱托类型：">{{vm.entrust.entrustType == 'audio' ? '音频嘱托' : '文字嘱托'}}</td>
                    <td data-title="重点嘱托：">{{vm.entrust.importantState == 'true' ? '是' : '否'}}</td>
                    <td data-title="嘱托时间:">{{vm.entrust.entrustTime | date:'yyyy-MM-dd HH:mm'}}</td>
                </tr>
                <tr style="position: relative; box-shadow: none;">
                    <td data-title="正文:" style="border: 0px;">&nbsp;</td>
                    <td data-content>
                        <div ng-show="vm.entrust.entrustType == 'text'">
                            {{vm.entrust.entrustContent}}
                        </div>
                        <div ng-show="vm.entrust.entrustType == 'audio'">
                            <div class="entrust-audio-play-box">
                                <div class="entrust-audio-play"></div>
                                <div class="play-button paused" ng-click="playAudio()">
                                    <div class="left"></div>
                                    <div class="right"></div>
                                    <div class="triangle-1"></div>
                                    <div class="triangle-2"></div>
                                </div>
                            </div>
                            <audio src="{{vm.entrust.entrustAudioPath}}" controls style="display: none;"></audio>
                            <div class="loading-icon">
                                <div class="spinner" role="spinner"><div class="spinner-icon"></div></div>
                            </div>
                            <div class="audio-nprogress" style="width: 0%;"></div>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </ion-content>
    <ion-footer-bar class="bar bar-footer" style="background: #55ABD4;" ng-show="vm.loginAccount.memberType == '1' && vm.entrust.entrustState != 'execute'">
        <h1 class="title" ng-click="postMemberInfo()" style="color: #ffffff;">确认回执</h1>
    </ion-footer-bar>
    <!--ios 菜单-->
    <div>
        <div class="weui-mask" id="iosMask" style="display: none"></div>
        <div class="weui-actionsheet" id="iosActionsheet">
            <div class="weui-actionsheet__title">
            </div>
            <div class="weui-actionsheet__menu">
                <div class="weui-actionsheet__cell" ui-sref="entrust.create({entrustId:vm.entrust.id})">
                    <i class="ion ion-compose" style="width:15px;margin-right: 10px;"></i>修改嘱托
                </div>
                <div class="weui-actionsheet__cell" ng-click="deleteEntrust(vm.entrust.id)">
                    <i class="ion ion-ios-trash" style="width:15px;margin-right: 10px;"></i>删除嘱托
                </div>
            </div>
            <div class="weui-actionsheet__action">
                <div class="weui-actionsheet__cell" id="iosActionsheetCancel">取消</div>
            </div>
        </div>
    </div>

    <!--android 菜单-->
    <div class="weui-skin_android" id="androidActionsheet" style="display: none">
        <div class="weui-mask"></div>
        <div class="weui-actionsheet">
            <div class="weui-actionsheet__menu">
                <div class="weui-actionsheet__cell" ui-sref="entrust.create({entrustId:vm.entrust.id})">
                    <i class="ion ion-compose" style="width:15px;margin-right: 10px;"></i>修改嘱托
                </div>
                <div class="weui-actionsheet__cell" ng-click="deleteEntrust(vm.entrust.id)">
                    <i class="ion ion-ios-trash" style="width:15px;margin-right: 10px;"></i>删除嘱托
                </div>
            </div>
        </div>
    </div>
</ion-view>